/*
 * @Author: 姚潘涛
 * @Date: 2024-04-08 20:36:39
 * @LastEditors: 姚潘涛
 * @LastEditTime: 2024-04-10 09:23:27
 * @FilePath:
 * /xict_ws/src/xcmg-intelligent-cockpit-three/src/xict_ui/include/xict_ui_core/imageglitem.h
 * @Description:
 *
 * Copyright (c) 2024 by pandaman, All Rights Reserved.
 */
#ifndef IMAGEGLITEM_H
#define IMAGEGLITEM_H

#include "xict_ui_common/utils/utils.h"
#include <QImage>
#include <QQuickFramebufferObject>

struct Context;
class ImageGLItem : public QQuickFramebufferObject {
    Q_OBJECT

    BJ_PROPERTY(int, cut_num)       // 屏幕总数
    BJ_PROPERTY(int, image_index)   // 图像编号
    BJ_PROPERTY(bool, top_screen)   // 是否为顶部屏幕
    BJ_PROPERTY(bool, revolve)      //是否旋转

public:
    explicit ImageGLItem(QQuickItem* parent = nullptr);
    virtual QQuickFramebufferObject::Renderer* createRenderer() const override;
    QSharedPointer<Context> context();

public slots:
    void paintImage(const QImage& image, int state);

private:
    QSharedPointer<Context> m_ctx;
};

#endif   // IMAGEGLITEM_H
